#ifndef HILL_CUBE
#define HILL_CUBE

#ifndef HILL_MESH
#include "Hill_Mesh.h"
#endif

//prototype the texture loading function contained in
//another file
GLuint loadTexturewithSDL(const char*, GLenum);

/**
 *  Derivative of Hill_Mesh
 *  A textured cube
 *  holds its own data- vertices, texture coordinates and normals
 */
class Hill_Cube : public Hill_Mesh
{	
public:
	/** CTOR */
	Hill_Cube()
	{	
		/* Initialize vertex data statically and pass to Hill_Mesh's protected 
		 * functions */
		
		//vertices
		static GLfloat vertices[] = 
		{
			1,1,1,  -1,1,1,  -1,-1,1,  1,-1,1,        // v0-v1-v2-v3
			1,1,1,  1,-1,1,  1,-1,-1,  1,1,-1,        // v0-v3-v4-v5
			1,1,1,  1,1,-1,  -1,1,-1,  -1,1,1,        // v0-v5-v6-v1
			-1,1,1,  -1,1,-1,  -1,-1,-1,  -1,-1,1,    // v1-v6-v7-v2
			-1,-1,-1,  1,-1,-1,  1,-1,1,  -1,-1,1,    // v7-v4-v3-v2
			1,-1,-1,  -1,-1,-1,  -1,1,-1,  1,1,-1
		};   // v4-v7-v6-v5
		
		//texture coordinates
		static GLfloat tex_coords[] =
		{
			1.0f, 0.0f,
			1.0f, 1.0f,
			0.0f, 1.0f,
			0.0f, 0.0f,
			
			1.0f, 0.0f,
			1.0f, 1.0f,
			0.0f, 1.0f,
			0.0f, 0.0f,
			
			1.0f, 0.0f,
			1.0f, 1.0f,
			0.0f, 1.0f,
			0.0f, 0.0f,
			
			1.0f, 0.0f,
			1.0f, 1.0f,
			0.0f, 1.0f,
			0.0f, 0.0f,
			
			1.0f, 0.0f,
			1.0f, 1.0f,
			0.0f, 1.0f,
			0.0f, 0.0f,
			
			1.0f, 0.0f,
			1.0f, 1.0f,
			0.0f, 1.0f,
			0.0f, 0.0f,
		};
		
			// normal array
		static GLfloat normals[] = {
			    0,0,1,  0,0,1,  0,0,1,  0,0,1,             // v0-v1-v2-v3
				1,0,0,  1,0,0,  1,0,0, 1,0,0,              // v0-v3-v4-v5
				0,1,0,  0,1,0,  0,1,0, 0,1,0,              // v0-v5-v6-v1
				-1,0,0,  -1,0,0, -1,0,0,  -1,0,0,          // v1-v6-v7-v2
				0,-1,0,  0,-1,0,  0,-1,0,  0,-1,0,         // v7-v4-v3-v2
				0,0,-1,  0,0,-1,  0,0,-1,  0,0,-1};        // v4-v7-v6-v5
			
		//set the vertices back
		setNormals(normals);	
		setTexCoords(tex_coords);
		setVertices (vertices);
	}
	//virtual DTOR
	virtual ~Hill_Cube();
	//virtual draw func
	virtual void draw();
};
#endif